<template>
  <div>
    <div class="page_title">暗访管理</div>
    <FormTable :formRules="formRules" :tableData="table.tableData" :columns="table.columns" :total="total"
      :currentPage="listQuery.pageNo" :pageSize="listQuery.pageSize" @changeTableData="changeTableData">
      <template #check="{ slotProps }">
        <el-tag class="ml-2" :type="slotProps.check ? 'success' : 'danger'">
          {{ checkFilter(slotProps.check) }}
        </el-tag>
      </template>
      <template #operator="{ slotProps }" class="table_button_list">
        <span class="table_button" @click="goToDetail(slotProps)">查看</span>
        <el-divider direction="vertical" />
        <span class="table_button" @click="anfangApply(slotProps)">暗访结果录入</span>
      </template>
    </FormTable>
  </div>
</template>
<script name="list-two" setup>
import FormTable from "@/components/FormTable/index.vue";
import { useRouter } from "vue-router";
import { anfangList } from '@/api/rzsq'
const router = useRouter();
let queryParams = { "pageNum": 1, "pageSize": 10, "groups": [], "rules": [], "orderBys": [] }
function anfangApply(props){
  router.push({ path: '/rzsq/anfang/apply', query: { id:props.applicationId } })
}
onMounted(() => {
  anfangList(queryParams).then(res => {
    table.tableData = res.data.list
  })
})
let listQuery = ref({
  pageNo: 1,
  pageSize: 10
});
let total = ref(0);
const table = reactive({
  tableData: [],
  columns: [
    {
      label: "序号",
      type: "index",
      width: '70px'
    },
    {
      label: "申请单位",
      field: "name",
    },
    {
      label: "申请日期",
      field: "email",
    },
    {
      label: "申请单位名称",
      field: "email",
    },
    {
      label: "当前节点",
      field: "email",
    },
    {
      label: "当前状态",
      field: "email",
    },
    {
      label: "联系人",
      field: "email",
    },
    {
      label: "联系电话",
      field: "email",
    },
    {
      prop: 'operator',
      label: "操作",
      field: "email",
      width: '160px'
    },
  ],
  totalRecordCount: 10,
  sortable: {},
});
const formRules = ref([
  {
    type: "input",
    field: "username",
    title: "申请单位",
    value: "",
  },
  {
    type: "datePicker",
    field: "password",
    props: {
      type: "password",
    },
    title: "申请日期",
    value: "",
  },
  {
    type: "input",
    field: "username12",
    title: "申请单位名称",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "联系人",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "联系电话",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "暗访日期",
    value: "",
  },
  {
    type: "input",
    field: "username",
    title: "暗访人员",
    value: "",
  },
]);
const goToDetail = () => {
  router.push({ path: "/rzsq/detail", query: { tab: 'anfang' } });
}
</script>
<style lang="scss" scoped></style>
